{% capture footer_custom %}
  {%- include footer_custom.html -%}
{% endcapture %}
{% if footer_custom != "" or site.last_edit_timestamp or site.gh_edit_link %}
  <hr>
  <footer>
    {% if site.back_to_top %}
      <p><a href="#top" id="back-to-top">{{ site.back_to_top_text }}</a></p>
    {% endif %}

    {{ footer_custom }}

    {% if site.last_edit_timestamp or site.gh_edit_link %}
      <div class="d-flex mt-2">
        {% if site.last_edit_timestamp and site.last_edit_time_format and page.last_modified_date %}
          <p class="text-small text-grey-dk-000 mb-0 mr-2">
            Page last modified: <span class="d-inline-block">{{ page.last_modified_date | date: site.last_edit_time_format }}</span>.
          </p>
        {% endif %}
        {% if
          site.gh_edit_link and
          site.gh_edit_link_text and
          site.gh_edit_repository and
          site.gh_edit_branch and
          site.gh_edit_view_mode
        %}
          <p class="text-small text-grey-dk-000 mb-0">
            <a href="{{ site.gh_edit_repository }}/{{ site.gh_edit_view_mode }}/{{ site.gh_edit_branch }}{% if site.gh_edit_source %}/{{ site.gh_edit_source }}{% endif %}{% if page.collection and site.collections_dir %}/{{ site.collections_dir }}{% endif %}/{{ page.path }}" id="edit-this-page">{{ site.gh_edit_link_text }}</a>
          </p>
        {% endif %}
      </div>
    {% endif %}
  </footer>
{% endif %}
